package com.gtt.jr.action.admin;

import java.util.List;

import javax.annotation.Resource;

import com.gtt.jr.action.base.BaseModelAction;
import com.gtt.jr.action.model.MenuModel;
import com.gtt.jr.app.TypeRepository;
import com.gtt.jr.app.domain.TypeVO;

public class MenuAction extends BaseModelAction<MenuModel> {

	private static final long serialVersionUID = 7611881732717980014L;

	@Resource
	private TypeRepository typeRepository;

	@Override
	public String execute() throws Exception {
		getModel().setTypes(getTypes());
		return JSON;
	}

	private List<TypeVO> getTypes() {
		return typeRepository.findAll();
	}

}
